// pages/my/set/branchShop/branchShop.js
  const app = getApp()
Page({
  data: {
    vipUserName:'',
    shops:[]
  },
  onLoad: function (options) {
    app.getMemInfo().then(res=>{
      this.setData({
        vipUserName:res.data.vipUserName
      })
      this.getShop(res.data.vipUserName)
    })
  },
  onShow: function () {

  },
  getShop(agentAdminName){
    let data = {
      agentAdminName
    }
    app.request('wx_app/agent_account/findByAgentAdmin',data,'GET').then(res=>{
      console.log(res)
      if (res.code==1) {
        let shops = []
        res.data.forEach(item=>{
          shops.push(item)
        })
        this.setData({
          shops
        })
      }else{
        app.errorMsg(res.message)
      }
    })
  }
})